import request from '@/utils/request'

const useWarehouseStore = defineStore('warehouse', {
    state: () => ({
        // 用户列表
        warehouseList: []
    }),
    actions: {
        init() {
            request({
                url: '/warehouse/listAll'
            }).then(res => {
                this.warehouseList = res;
            });
        },
        // 获取用户列表
        getWarehouseList() {
            return this.warehouseList;
        },
        // 设置用户列表
        setWarehouseList(list) {
            this.warehouseList = list;
        },
    }
})

export default useWarehouseStore
